package com.liull.netty.nio.eventloop;

import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.util.NettyRuntime;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 13:46 2021/7/24
 * @Modified By:
 */
@Slf4j
public class EventLoopTest {
    public static void main(String[] args) {
        EventLoopGroup group = new NioEventLoopGroup(2);
        final int processors = NettyRuntime.availableProcessors();
        System.out.println(processors);

        System.out.println(group.next());
        System.out.println(group.next());
        System.out.println(group.next());
        System.out.println(group.next());

        // 执行普通任务
        group.next().execute(()->{
            log.debug("ddd");
        });
    }
}
